home *** CD-ROM | disk | FTP | other *** search
/ ftp.cs.arizona.edu / ftp.cs.arizona.edu.tar / ftp.cs.arizona.edu / icon / newsgrp / group02b.txt / 000010_icon-group-sender_Fri Aug 16 16:15:17 2002.msg < prev    next >
Internet Message Format  |  2003-01-02  |  3KB

  1. Return-Path: <icon-group-sender>
  2. Received: (from root@localhost)
  3.     by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id g7GNFEI23155
  4.     for icon-group-addresses; Fri, 16 Aug 2002 16:15:14 -0700 (MST)
  5. Message-Id: <200208162315.g7GNFEI23155@baskerville.CS.Arizona.EDU>
  6. From: Jesse Tov <tov@fas.harvard.REMOVE.edu>
  7. X-Newsgroups: comp.lang.icon
  8. Subject: Re: What about "Expressions?" (was Re: Icon Wish List)
  9. Date: 16 Aug 2002 17:42:06 GMT
  10. User-Agent: slrn/0.9.7.4 (Linux)
  11. To: icon-group@cs.arizona.edu
  12. Errors-To: icon-group-errors@cs.arizona.edu
  13. Status: RO
  14.  
  15. Gene Kahn <jenjhiz@yahoo.com>:
  16. > previous statements. On the other hand, in reading s-expression
  17. > languages like Lisp and Scheme, I find that I have to hold in my mind
  18. > too many _unstated_ intermediate results before I find what the
  19. > expression is all about. (One could argue that this may be due more to
  20. > bad code, i.e., irresponsible use of deep embedding, than to intrinsic
  21. > properties of s-expressions).
  22.  
  23. I would argue that it's bad code.  That's what "let" ("let"
  24. in ML, "let*" in Scheme) is for.  (I don't know Lisp well
  25. enough, but I bet there's something equivalent.)
  26.  
  27. > Compare the readability of these chunks
  28. > of code:
  29. >
  30. > FORTRAN-like
  31. > The man kicked the dog.
  32. > The dog chased the cat.
  33. > The cat bit the mouse.
  34. > The mouse died. 
  35. > LISP-like (in infix notation)
  36. > The mouse the cat the dog the man kicked chased bit died.
  37.  
  38. ML-like
  39. The man kicked the dog
  40. which chased the cat
  41. which bit the mouse
  42. which died.
  43.  
  44. (OK, so "let" to "which" is sort of a stretch, but "which"
  45. lets you stop remembering everything and encapsulate it as a
  46. temporary variable, a "pronoun," if you will.  It makes the
  47. sentence right-branching, and thus easier to read.)
  48.  
  49. > Speaking of speaking (or writing) grammatical English, which skill has
  50. > been implied in a recent post as a 'requisite' for programming, what
  51. > do readers with good English grammar think of this sentence:
  52. > grammatically correct or not? Be careful with your answer. Your
  53. > reputation as a programmer is on the line.
  54. > The horse raced past the barn collapsed. 
  55.  
  56. Well, I can't find any way to parse it that has the barn collapsing
  57. rather than the horse.  In my dialect, it's is equivalent to
  58.    The horse which was raced past the barn collapsed.
  59. and is perfectly grammatical.  However, I know in some people's
  60. dialects (my grandfather, from eastern Pennsylvania), it's more like:
  61.    The horse which raced past the barn collapsed.
  62. When I hear it like this, it's ungrammatical to me.
  63.  
  64. Jesse
  65. -- 
  66. "A hungry man is not a free man."         --Adlai Stevenson
  67.